//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
//------------------------------------------------------------------------------
//
//  Header: s3c6410_spi.h
//
//  Defines the Serial Peripheral Interface (SPI) controller CPU register layout and
//  definitions.
//
#ifndef __S3C6410_SPI_H
#define __S3C6410_SPI_H

#if __cplusplus
    extern "C"
    {
#endif

typedef struct  
{
    UINT32      CH_CFG;        // 00
    UINT32      CLK_CFG;       // 04
    UINT32      MODE_CFG;      // 08
    UINT32      SLAVE_SEL;     // 0C
    UINT32      SPI_INT_EN;    // 10
    UINT32      SPI_STATUS;    // 14
    UINT32      SPI_TX_DATA;   // 18
    UINT32      SPI_RX_DATA;   // 1C
    UINT32      PACKET_COUNT;  // 20
    UINT32      PENDING_CLEAR; // 24
    UINT32      SWAP_CFG;      // 28
    UINT32      FB_CLK_SEL;    // 2C
} S3C6410_SPI_REG, *PS3C6410_SPI_REG; 



#define    SPI_MASTER_MODE    1
#define    SPI_SLAVE_MODE        0

typedef struct {
    DWORD                    dwMode;

    BOOL                    bUseFullDuflex;

    DWORD                    dwRxBurstDataLen;
    BOOL                    bUseRxDMA;
    BOOL                    bUseRxIntr;

    DWORD                    dwTxBurstDataLen;
    BOOL                    bUseTxDMA;
    BOOL                    bUseTxIntr;

    DWORD                    dwPrescaler;
    DWORD                    dwTimeOutVal;
} SET_CONFIG, *PSET_CONFIG;



//------------------------------------------------------------------------------

#if __cplusplus
       }
#endif

#endif    // __S3C6410_SPI_H
